package com.sinog.core.util;

import com.sinog.core.utilbean.Constants;
import java.util.HashMap;
import java.util.Map;

/**
 * @desc 用户返回信息
 * @author lzq
 * @date 2020-08-31 3:27 下午
 */
public final class ResultUtil {

    /**
     * 描述
     * @param data data
     * @return Map<String,Object>
     */
    public static Map<String,Object> getResult(boolean data) {
        Map<String,Object> map = new HashMap<>(16);
        map.put("data",data);
        if(data) {
            map.put("code",1);
            map.put("message",Constants.HnInterfaceDocking.SUCCESS);
        } else {
            map.put("code",-1);
            map.put("message",Constants.HnInterfaceDocking.FAILURE);
        }
        return map;
    }
}